new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
NULL);
+ new_context->display = gdk_window_get_display (window);
return new_context;
}
}
GdkCursor *
-gdk_drag_get_cursor (GdkDragAction action)
+gdk_drag_get_cursor (GdkDragContext *context,
+ GdkDragAction action)
{
gint i;
break;
if (drag_cursors[i].cursor == NULL)
- drag_cursors[i].cursor = gdk_cursor_new_from_name (gdk_display_get_default (),
+ drag_cursors[i].cursor = gdk_cursor_new_from_name (context->display,
drag_cursors[i].name);
return drag_cursors[i].cursor;
}
/*< private >*/
GdkDragProtocol protocol;
+ GdkDisplay *display;
+
gboolean is_source;
GdkWindow *source_window;
GdkWindow *dest_window;
GdkDragCancelReason reason);
gboolean gdk_drag_context_handle_source_event (GdkEvent *event);
gboolean gdk_drag_context_handle_dest_event (GdkEvent *event);
-GdkCursor * gdk_drag_get_cursor (GdkDragAction action);
+GdkCursor * gdk_drag_get_cursor (GdkDragContext *context,
+ GdkDragAction action);
G_END_DECLS
window = [[self contentView] gdkWindow];
+ current_context->display = gdk_window_get_display (window);
+
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
gdk_drag_context_set_device (current_context,
gdk_device_manager_get_client_pointer (device_manager));
/* Create fake context */
_gdk_quartz_drag_source_context = g_object_new (GDK_TYPE_QUARTZ_DRAG_CONTEXT,
NULL);
+ _gdk_quartz_drag_source_context->display = gdk_window_get_display (window);
_gdk_quartz_drag_source_context->is_source = TRUE;
_gdk_quartz_drag_source_context->source_window = window;
seat->data_device =
wl_data_device_manager_get_data_device (display_wayland->data_device_manager,
seat->wl_seat);
- seat->drop_context = _gdk_wayland_drop_context_new (seat->data_device);
+ seat->drop_context = _gdk_wayland_drop_context_new (display,
+ seat->data_device);
wl_data_device_add_listener (seat->data_device,
&data_device_listener, seat);
{
GdkCursor *cursor;
- cursor = gdk_drag_get_cursor (action);
+ cursor = gdk_drag_get_cursor (context, action);
gdk_drag_context_set_cursor (context, cursor);
}
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
+ context->display = gdk_window_get_display (window);
context->source_window = g_object_ref (window);
context->is_source = TRUE;
context->targets = g_list_copy (targets);
}
GdkDragContext *
-_gdk_wayland_drop_context_new (struct wl_data_device *data_device)
+_gdk_wayland_drop_context_new (GdkDisplay *display,
+ struct wl_data_device *data_device)
{
GdkWaylandDragContext *context_wayland;
GdkDragContext *context;
context_wayland = g_object_new (GDK_TYPE_WAYLAND_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT (context_wayland);
+ context->display = display;
context->is_source = FALSE;
return context;
void _gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window,
int x,
int y);
-GdkDragContext * _gdk_wayland_drop_context_new (struct wl_data_device *data_device);
+GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
+ struct wl_data_device *data_device);
void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
GdkWindow *window);
void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
context_win32 = g_object_new (GDK_TYPE_WIN32_DRAG_CONTEXT, NULL);
context = GDK_DRAG_CONTEXT(context_win32);
+ context->display = display;
gdk_drag_context_set_device (context, gdk_seat_get_pointer (gdk_display_get_default_seat (display)));
context_x11 = (GdkX11DragContext *)g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
context = (GdkDragContext *)context_x11;
+ context->display = display;
context->protocol = GDK_DRAG_PROTO_XDND;
context_x11->version = version;
context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, NULL);
+ context->display = gdk_window_get_display (window);
context->is_source = TRUE;
context->source_window = window;
g_object_ref (window);
{
GdkCursor *cursor;
- cursor = gdk_drag_get_cursor (action);
+ cursor = gdk_drag_get_cursor (context, action);
gdk_drag_context_set_cursor (context, cursor);
}